Free online tool

Free Online Random Number Generator

Generate random numbers in any range with no repeats, roll dice, flip coins and pick lottery numbers, using secure and unbiased randomness.

Random Number GeneratorFree online tool. Runs in your browser.
Live

You need a number between 1 and 100. Or a winner for a classroom draw, a dice roll for a board game, or a coin flip to settle an argument. This page generates all of these. The numbers come from your browser’s secure random number source, and the tool takes care to make every value in your range equally likely, which is harder than it sounds.

What “random” means for a computer

A computer is deterministic, so a plain program cannot truly choose at random. Many programs use a formula that produces numbers that look random, called a pseudo-random generator. They are fine for games, but they can be predicted if you know the formula and the starting point. Browsers also offer a cryptographic generator, which collects unpredictable data from the device and is designed so that its output cannot be guessed. This tool uses that one. It is the same kind of source used to create encryption keys.

The hidden problem: bias

Suppose a generator gives a random number from 0 to 255 and you want a number from 0 to 199. A common shortcut is to take the remainder after dividing by 200. But 256 does not divide evenly by 200, so the values 0 to 55 each appear twice as often as the others. That is called modulo bias. It is small for casual use, but unfair for a prize draw. This tool avoids it with rejection sampling: it draws a number, and if it falls in the uneven leftover part, it throws it away and draws again. Every value in the range then has exactly the same chance. For large ranges, it draws as many bytes as it needs and uses exact big integers, so ranges of 30 digits and more work correctly.

What you can do

Tab What it does Options
Whole numbers Numbers between a minimum and maximum How many (up to 1,000), no repeats, sort
Decimals Numbers with 1 to 8 decimal places Range, how many, sort
Dice d4, d6, d8, d10, d12, d20, d100 Up to 100 dice, with total, highest and lowest
Coin flip Heads or tails One flip or up to 1,000 with counts
Lottery picks Different numbers from 1 to a maximum How many, bonus numbers

Picking without repeats

With “No repeats” ticked, every number in the results is different, like drawing numbers from a hat without putting them back. For ranges up to 100,000, the tool builds the list of all numbers and does a fair shuffle (the Fisher-Yates method), taking the first ones. For larger ranges, it draws and discards repeats. If you ask for more different numbers than the range holds, such as five different numbers from 1 to 3, it tells you rather than failing silently.

Dice and probabilities

Each die is independent and fair, so each face has the same chance. But totals are not equally likely. With two six-sided dice, there are 36 possible pairs, and a total of 7 can come up in 6 of them, which is one chance in six, or 16.7 percent. A total of 2 or 12 can come up in only one pair each, a 2.8 percent chance. That is why 7 is the most common roll in many board games. The tool shows the total, the highest and the lowest of your roll.

Lottery picks, honestly

The lottery tab picks different numbers from a range, with optional bonus numbers. It is for fun. Every combination has the same chance of winning, so a “random” ticket has no better or worse odds than one made from birthdays. For a lottery where you choose 6 numbers from 49, there are 13,983,816 possible combinations, so the chance of any one ticket matching all six is about one in fourteen million. No method improves that. Never spend money you cannot afford to lose, and play only where it is legal.

A worked example

A teacher wants to pick five students from a class numbered 1 to 28. She chooses Whole numbers, sets the minimum to 1 and the maximum to 28, asks for 5 numbers and ticks “No repeats”. The tool builds a list of 28 numbers, shuffles it fairly and shows the first five, for example 7, 19, 3, 24 and 11. Each student had the same chance, and nobody can appear twice. Ticking “Sort the results” lists them in order for the register.

Common mistakes

  • Using a random number for a security purpose that needs more care, such as a password. Use a password generator for that.
  • Believing that a number is “due”. Random draws have no memory.
  • Seeing a streak as proof of bias. Short runs of the same value are normal.
  • Asking for more unique numbers than the range holds.
  • Using a public draw that people cannot verify. If trust matters, run it where everyone can watch.

Privacy and limits

Everything happens in your browser. Nothing is sent or stored. Whole-number ranges can have 30 digits or more, but you can request at most 1,000 values at once. Decimal ranges are limited to a trillion either way to keep arithmetic exact. For legal draws or gambling, follow the rules that apply where you are.

See also the random name picker, the decision maker wheel and the password generator. If you enjoy the maths of chance, the basic math course covers probability, and the Python course shows how to build a generator of your own.

Key takeaways

  • The numbers come from a secure source, not a guessable formula.
  • Rejection sampling removes modulo bias, so all values are equally likely.
  • Dice totals are not equally likely even though each face is.
  • Lottery numbers are for fun; no method improves your odds.

Questions

Are these numbers truly random?

They come from your browser's cryptographically secure random generator, which uses unpredictable data from your device and cannot be guessed from earlier results. Strictly, no program creates true physical randomness, but this source is suitable for fair draws, games and security uses, unlike simple formula-based generators.

What is modulo bias and how do you avoid it?

Modulo bias happens when a random number is reduced to a range with a remainder operation and the range does not divide evenly, making some values slightly more likely. This tool uses rejection sampling: it throws away draws that fall into the uneven leftover part and draws again, so every value has the same chance.

Can I pick numbers without repeats?

Yes. Tick No repeats on the whole numbers tab. Every result will be different, like drawing numbers from a hat. If you ask for more different numbers than the range holds, such as five from 1 to 3, the tool tells you and does not produce a result.

Why do two dice total 7 more often than 2 or 12?

Each die is fair, but there are 36 possible pairs and six of them add to 7, while only one pair gives 2 and only one gives 12. So 7 has a one in six chance and 2 or 12 about 2.8 percent. Totals are more likely when more combinations make them.

Can I improve my chance of winning the lottery with this tool?

No. Every combination in a fair lottery has the same chance, and a random pick is no better than any other. For 6 numbers from 49 there are 13,983,816 combinations. The lottery tab is for fun only, so never spend money you cannot afford to lose.